package com.hopes.bizz.common.core.controller;

import com.hopes.boss.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.HashMap;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 控制器基类
 * @time 2023/5/30 9:53
 */
@Slf4j
public abstract class BaseController {

    /**
     * 获取初始化参数
     *
     * @author xk
     * @since [1.1.0.0]
     * @version [1.1.0.0, 2020-07-02]
     */
    @Operation(summary = "获取初始化参数" , description = "获取初始化参数" )
    @SuppressWarnings("all")
    @GetMapping(value = "initParam")
    public R initParam() {
        try {
            HashMap<String, Object> map = new HashMap<>();
            setInitParam(map);
            return R.ok(map);
        } catch (Exception ex){
            log.error("获取初始化参数出错",ex);
            return R.failed("获取初始化参数出错");
        }
    }

    /**
     * 设置初始化参数
     * @param map 数据
     */
    protected void setInitParam(HashMap<String, Object> map){

    }


}
